import React, { Suspense } from 'react';
import { ConfigProvider, Spin } from "antd";
import zhCN from "antd/locale/zh_CN";
import './styles/common.css';
import './App.css';
// // <Switch>组件已在react-router-dom 6.x版本中删除，并替换为<Routes>。
import { BrowserRouter } from "react-router-dom";
import WrapperRoutes from './routes/index';

function App() {
    const primaryColor = '#0081FF'
    return (
        <ConfigProvider
            locale={zhCN}
            theme={{
                token: {
                    colorPrimary: primaryColor,
                },
            }}
        >
            <BrowserRouter>
                <Suspense fallback={<Spin size="large" className="globa_spin" />}>
                    <WrapperRoutes />
                </Suspense>
            </BrowserRouter>
        </ConfigProvider>

    );
}
export default App;


// src/App.js
// import React from "react";

// import { BrowserRouter as Routes } from "react-router-dom"

// import { renderRoutes } from "./util/index"
// import routerConfig from "./config/router"

// import "./App.css"

// function App() {
//     return (
//         <Routes>
//             {/* <Route path="/" component={Home} /> */}
//             // 修改为函数式渲染
//             {renderRoutes(routerConfig)}
//         </Routes>
//     );
// }

// export default App;
